package serviceimpl;

import java.util.List;

import service.ISaleService;
import vo.Employee;
import vo.Payment;
import vo.Saleorder;
import vo.Saleorderitem;
import vo.Showitem;
import dao.ISaleDao;

public class SaleService implements ISaleService {
	ISaleDao saleDao;
	
	public ISaleDao getSaleDao() {
		return saleDao;
	}

	public void setSaleDao(ISaleDao saleDao) {
		this.saleDao = saleDao;
	}
	   //======1.验证登陆，获得员工对象=============
	public Employee getEmployee(String name,String password){
		return saleDao.getEmployee(name, password);
	}
	   //======2.添加订单=============
	public void addSaleorder(Saleorder saleorder) {
		saleDao.addSaleorder(saleorder);
		
	}
	//=======================================2.更新订单===============================================
	public void updateSaleorder(Saleorder saleorder) {
		saleDao.updateSaleorder(saleorder);
	}
	
	//======3.添加订单明细表=============
	public void addSaleorderitem(Saleorderitem saleorderitem) {
		saleDao.addSaleorderitem(saleorderitem);
		
	}
	//===============4.获得明细表所有记录====================
		public List<Saleorderitem> getAllItem(){
			return saleDao.getAllItem();
		}
		
		//===============6.获得临时表的总金额===================
		public float getTotalPrice() {
			// TODO Auto-generated method stub
			return saleDao.getTotalPrice();
		}
		//===============7.添加结算记录===================
		public void addPayment(Payment payment) {
			saleDao.addPayment(payment);
		}
		//===============8.通过撒了saleorderID获得订单明细===================
		public List<Saleorderitem> getAllItemById(String saleorderid){
			return saleDao.getAllItemById(saleorderid);
		}
		//================9.通过hql语句操作数据库表saleorderitem==
		  public void sale_updateByHql(String hql){
			  saleDao.sale_updateByHql(hql);
		  }
		//================10.通过saleorderid获得订单明细表记录==
		  public Saleorderitem getSaleorderitemById(String saleorderitemid){
			  return saleDao.getSaleorderitemById(saleorderitemid);
		  }

	//================11.通过hql获得订单表记录=======
	  public Saleorder getSaleorderByHql(String hql){
		  return saleDao.getSaleorderByHql(hql);}
}
